package cn.com.w.dm7.controller;


import cn.com.w.dm7.entity.User;
import cn.com.w.dm7.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/test")
public class TestController {


    @Autowired
    UserService userService;

    @GetMapping("/getData")
    public String getData(){
        return "hello word";
    }

    @GetMapping("/getUser")
    public String getUser(){

        List<User> userList = userService.getUserList();

        System.out.println(userList.toString());
        return userList.toString();
    }
}
